<template>
  <div class="login-log-list">
    <de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" class="pa-5">
      <avue-crud
        ref="crud"
        v-model="form"
        :page.sync="page"
        :data="tableData"
        :table-loading="tableLoading"
        :option="tableOption"
        :search.sync="searchForm"
        @on-load="loadListData"
        @search-change="onSearchChange"
        @search-reset="onSearchReset"
        @refresh-change="onRefresh"
        @selection-change="onSelectionChange"
        @filter-change="onFilterChange"
        @sort-change="onSortChange"
      >
      </avue-crud>
    </de-container>
  </div>
</template>

<script>
import { getApplyHistory } from '@/api/chart/chart'
import DeContainer from '@/components/dataease/DeContainer'
import ListMixin from '@/utils/mixins/list-mixin'
// import { DATA_TYPE_OPTIONS } from './index.vue'

export default {
  name: 'ApplyHistory',
  components: { DeContainer },
  mixins: [ListMixin],
  data() {
    return {
      listApi: getApplyHistory,
      tableOption: {
        menuWidth: 120,
        menu: false,
        addBtn: false,
        editBtn: false,
        viewBtn: false,
        delBtn: false,
        selection: false,
        index: true,
        searchLabelWidth: 100,
        searchMenuPosition: 'left',
        column: [
          {
            label: '申请时间',
            prop: 'createdAt',
            span: 12,
            align: 'left',
            overHidden: true,
          },
          // {
          //   label: '申请时效',
          //   prop: 'name',
          //   span: 12,
          //   align: 'left',
          //   search: true,
          //   overHidden: true,
          // },

          {
            label: '申请原因',
            prop: 'reason',
            span: 12,
            align: 'left',
            overHidden: true,
          },
          {
            label: '审核时间',
            prop: 'approveTime',
            span: 12,
            align: 'left',
            overHidden: true,
          },
          // {
          //   label: '数值类型',
          //   prop: 'dataType',
          //   type: 'select',
          //   search: true,
          //   span: 8,
          //   dicData: DATA_TYPE_OPTIONS,
          // },
          {
            label: '审核结果',
            prop: 'approveStatus',
            span: 24,
            width: 150,
            align: 'center',
            type: 'select',
            dicData: [
              { label: '待审核', value: '0' },
              { label: '通过', value: '1' },
              { label: '驳回', value: '2' },
            ],
          },
          {
            label: '审核意见',
            prop: 'approveRemark',
            span: 24,
            width: 150,
            align: 'center',
          },
        ],
      },
    }
  },
  methods: {
    goDetail(row) {
      this.$router.push(`/redirect/charts/${row.id}/view?type=2`)
    },
    goApply(row) {
      this.$router.push(`/redirect/charts/${row.id}/apply`)
    },
  },
}
</script>

<style lang="scss"></style>
